﻿@model Scorecard
@{
    const string S = "S";
    const string P = "P";
}

@using (Html.BeginForm("Edit", "Score", new { id = Model.Id }, FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
{
    <table class="scorehoriz">
        <thead>
            <tr class="text-center">
                <th>&nbsp;</th>
                @for (int i = 1; i < 19; i++)
                {
                    <th>@i</th>
                }
            </tr>
        </thead>
        <tbody class="text-center">
            <tr>
                <td>slag</td>
                @for (int i = 1; i < 19; i++)
                {
                    <td>
                        <input class="form-control input-sm" type="number" min="1" max="15" name="@Html.Raw(S + i)" value="@Model.GetStrokesForHole(i)">
                    </td>
                }
            </tr>
            <tr>
                <td>putts</td>
                @for (int i = 1; i < 19; i++)
                {
                    <td>
                        <input class="form-control input-sm" type="number" min="1" max="15" name="@Html.Raw(P + i)" value="@Model.GetPuttsForHole(i)">
                    </td>
                }
            </tr>

        </tbody>
        <tfoot>
            <tr>
                <td>&nbsp;</td>
                <td><button class="btn btn-default">gem</button></td>
                <td colspan="17"><hr></td>
            </tr>
        </tfoot>
    </table>
}
